﻿<UserControl
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
    x:Class="NumberGuessing.NumberGuessingGame"
    mc:Ignorable="d"
    d:DesignHeight="300"
    d:DesignWidth="400">
    <Grid
        x:Name="LayoutRoot">
        <VisualStateManager.VisualStateGroups>
            <VisualStateGroup
                x:Name="GameState">
                <VisualState
                    x:Name="LevelSelection">
                    <Storyboard>
                        <ObjectAnimationUsingKeyFrames
                            Storyboard.TargetProperty="(UIElement.Visibility)"
                            Storyboard.TargetName="_level">
                            <DiscreteObjectKeyFrame
                                KeyTime="0">
                                <DiscreteObjectKeyFrame.Value>
                                    <Visibility>Visible</Visibility>
                                </DiscreteObjectKeyFrame.Value>
                            </DiscreteObjectKeyFrame>
                        </ObjectAnimationUsingKeyFrames>
                        <ObjectAnimationUsingKeyFrames
                            Storyboard.TargetProperty="(UIElement.Visibility)"
                            Storyboard.TargetName="_game">
                            <DiscreteObjectKeyFrame
                                KeyTime="0">
                                <DiscreteObjectKeyFrame.Value>
                                    <Visibility>Collapsed</Visibility>
                                </DiscreteObjectKeyFrame.Value>
                            </DiscreteObjectKeyFrame>
                        </ObjectAnimationUsingKeyFrames>
                        <ObjectAnimationUsingKeyFrames
                            Storyboard.TargetProperty="(UIElement.Visibility)"
                            Storyboard.TargetName="stackPanel">
                            <DiscreteObjectKeyFrame
                                KeyTime="0">
                                <DiscreteObjectKeyFrame.Value>
                                    <Visibility>Collapsed</Visibility>
                                </DiscreteObjectKeyFrame.Value>
                            </DiscreteObjectKeyFrame>
                        </ObjectAnimationUsingKeyFrames>
                    </Storyboard>
                </VisualState>
                <VisualState
                    x:Name="Game">
                    <Storyboard>
                        <DoubleAnimation
                            Duration="0"
                            To="1"
                            Storyboard.TargetProperty="(UIElement.Opacity)"
                            Storyboard.TargetName="_game"
                            d:IsOptimized="True" />
                        <ObjectAnimationUsingKeyFrames
                            Storyboard.TargetProperty="(UIElement.Visibility)"
                            Storyboard.TargetName="stackPanel">
                            <DiscreteObjectKeyFrame
                                KeyTime="0">
                                <DiscreteObjectKeyFrame.Value>
                                    <Visibility>Collapsed</Visibility>
                                </DiscreteObjectKeyFrame.Value>
                            </DiscreteObjectKeyFrame>
                        </ObjectAnimationUsingKeyFrames>
                        <ObjectAnimationUsingKeyFrames
                            Storyboard.TargetProperty="(UIElement.Visibility)"
                            Storyboard.TargetName="_level">
                            <DiscreteObjectKeyFrame
                                KeyTime="0">
                                <DiscreteObjectKeyFrame.Value>
                                    <Visibility>Collapsed</Visibility>
                                </DiscreteObjectKeyFrame.Value>
                            </DiscreteObjectKeyFrame>
                        </ObjectAnimationUsingKeyFrames>
                    </Storyboard>
                </VisualState>
                <VisualState
                    x:Name="HighscoreEntry">
                    <Storyboard>
                        <ObjectAnimationUsingKeyFrames
                            Storyboard.TargetProperty="(UIElement.Visibility)"
                            Storyboard.TargetName="_level">
                            <DiscreteObjectKeyFrame
                                KeyTime="0">
                                <DiscreteObjectKeyFrame.Value>
                                    <Visibility>Collapsed</Visibility>
                                </DiscreteObjectKeyFrame.Value>
                            </DiscreteObjectKeyFrame>
                        </ObjectAnimationUsingKeyFrames>
                        <ObjectAnimationUsingKeyFrames
                            Storyboard.TargetProperty="(UIElement.Visibility)"
                            Storyboard.TargetName="_game">
                            <DiscreteObjectKeyFrame
                                KeyTime="0">
                                <DiscreteObjectKeyFrame.Value>
                                    <Visibility>Collapsed</Visibility>
                                </DiscreteObjectKeyFrame.Value>
                            </DiscreteObjectKeyFrame>
                        </ObjectAnimationUsingKeyFrames>
                        <ObjectAnimationUsingKeyFrames
                            Storyboard.TargetProperty="(UIElement.Visibility)"
                            Storyboard.TargetName="stackPanel">
                            <DiscreteObjectKeyFrame
                                KeyTime="0">
                                <DiscreteObjectKeyFrame.Value>
                                    <Visibility>Visible</Visibility>
                                </DiscreteObjectKeyFrame.Value>
                            </DiscreteObjectKeyFrame>
                        </ObjectAnimationUsingKeyFrames>
                    </Storyboard>
                </VisualState>
            </VisualStateGroup>
        </VisualStateManager.VisualStateGroups>
        <StackPanel
            x:Name="_level"
            Orientation="Vertical"
            VerticalAlignment="Center"
            HorizontalAlignment="Center" d:IsHidden="True">
            <Button
                x:Name="_level1"
                Content="Level 1"
                d:LayoutOverrides="Width"
                Click="_level1_Click" />
            <Button
                x:Name="_level2"
                Content="Level 2"
                d:LayoutOverrides="Width"
                Click="_level2_Click" />
            <Button
                x:Name="_level3"
                Content="Level 3"
                d:LayoutOverrides="Width"
                Click="_level3_Click" />
        </StackPanel>
        <Grid
            x:Name="_game" d:IsHidden="True">
            <StackPanel
                Orientation="Vertical"
                VerticalAlignment="Center">
                <TextBlock
                    x:Name="_challenge"
                    TextWrapping="Wrap"
                    Text="Zahlenraten 1 bis 100"
                    HorizontalAlignment="Center"
                    FontSize="26.667"
                    Foreground="#FFFF9800"
                    Margin="8" />
                <TextBlock
                    x:Name="_status"
                    TextWrapping="Wrap"
                    Text="Gib eine Zahl ein:"
                    d:LayoutOverrides="Width"
                    HorizontalAlignment="Center"
                    Margin="8"
                    Foreground="#BFFF9800"
                    FontSize="16" />
                <TextBox
                    x:Name="_input"
                    TextWrapping="Wrap"
                    d:LayoutOverrides="Width"
                    InputScope="Number" />
                <Button
                    x:Name="_enter"
                    Content="OK"
                    d:LayoutOverrides="Width"
                    Click="_enter_Click" />
            </StackPanel>
        </Grid>
        <StackPanel
            x:Name="stackPanel"
            HorizontalAlignment="Center"
            VerticalAlignment="Center" d:IsHidden="True">
            <TextBlock
                TextWrapping="Wrap"
                Text="Du hast die Zahl erraten!"
                HorizontalAlignment="Center"
                Foreground="#FFFF9800"
                FontSize="29.333" />
            <Button
                x:Name="_gameOverButton"
                Content="Ok"
                Click="_gameOverButton_Click" />

        </StackPanel>
    </Grid>
</UserControl>
